go to previous page   go to home page   go to next page

Answer:

Two. One per class, including the class whose job is merely to hold the static main method.


Running the Program

If Car.java contains the definition of the Car class and MilesPerGallon.java contains the above program and both are in the same disk directory, then the program could be compiled and run by doing:

Running Miles Per Gallon

You don't need to do the DIR commands, of course, but it is useful to see what is going on.


QUESTION 11:

Is the class MilesPerGallon used to create an object?